home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / tsq_jl < prev    next >
Internet Message Format  |  1995-03-31  |  15KB

  1. From: john Latala <john.Latala@Waterloo.NCR.COM>
  2. Subject:  v03i040:  tsq_jl - Times Square horizontally scrolling large text v1.0, Part01/01
  3. Newsgroups: comp.sources.hp48
  4. Organization: NCR Canada Ltd, Waterloo, Ontario, Canada.
  5. Followup-To: comp.sys.hp48
  6. Approved: spell@seq.uncwil.edu
  7.  
  8. Checksum: 2593912457 (verify with brik -cv)
  9. Submitted-by: john Latala <john.Latala@Waterloo.NCR.COM>
  10. Posting-number: Volume 3, Issue 40
  11. Archive-name: tsq_jl/part01
  12.  
  13.  
  14. BEGIN_DOC tsq.doc
  15. I posted a version of this quite some time back for the HP28. Here's my
  16. HP48 version of it.
  17.  
  18. The design of this version is quite different from the '28 version. That
  19. one had only one font available. This version uses a program to
  20. 'enlarge' the normal font. 
  21.  
  22. The routine MKFONT takes three arguments:
  23.  
  24.     - String of desired character set
  25.     - HP48 font number (1, 2, 3)
  26.     - zoom factor (usually 2, 3, 4)
  27.  
  28. Eventually the program stops after creating a character set list
  29. varialbe that contains a string of the character set and a large GROB of
  30. the bitmap.  The routine will save the character set list in a variable
  31. called: FfZz where 'f' is the supplied font and 'z' is the supplied zoom
  32. factor.  The character sets F3Z2 and F3Z3 work quite nicely.
  33.  
  34. You only have to run MKFONT to create the character set lists the first
  35. time. You can probably only keep these around if you have a RAM card
  36. installed in your '48 because they're quite large. Here are the sizes as
  37. returned by the BYTES program for various fonts:
  38.  
  39.     Font    Size
  40.     ----    ----
  41.     F3Z2    4988.5
  42.     F3Z3    10988.5
  43.     F3Z4    19388.5
  44.  
  45. To finally display a message put the message string on the stack, put a
  46. character set list on the stack then run the TSQ program itself. The
  47. large characters will scroll horizontally across the screen.
  48.  
  49. Any characters that are in the message, but not in the supplied
  50. character set list are ignored ( to change this look at T\->G ).
  51.  
  52. While TSQ is running a number of keys are usable:
  53.  
  54.     Key        Usage
  55.     ---        -----
  56.     ENTER        restart the display from the beginning
  57.     +         Increase the number of pixels moved
  58.     -        Dexrease the number of pixels moved
  59.     *        Increase the time delay between updates
  60.     /        Decrease the time delay between updates
  61.     other        Stop program after this pass ends
  62.  
  63. If you want to stop right away you can press any key, then the ENTER to
  64. force a new pass to start.
  65.  
  66. When moving the message across the screen in large steps it looks better
  67. to also use a large delay between screen updates.
  68.  
  69. The routine used to make the character set list is kind of slow, but it
  70. does work and only has to be run once...
  71.  
  72. Once problem that I had with this program was that any GROB stored into
  73. PICT can't be wider than 2048 pixels. If you're using one of the larger
  74. fonts and/or a long message this can easily be exceeded.
  75.  
  76. The initial version of the program just created the large GROB, stored
  77. it on PICT then used PVIEW to walk 'down' the length of the GRBO making
  78. it look like a scrolling display. This was quicker, but would blow up
  79. when the GROB was wider than 2048 pixels.
  80.  
  81. Enough talking, here's the program as a directory:
  82. END_DOC
  83.  
  84.  
  85. BEGIN_ASC tsq.asc
  86. %%HP: T(3)A(D)F(.);
  87. "69A20FF726E00000003045D87430D9D20E1632B7FC18DBF11C432D6E2030D637
  88. 76D6E207036861627375647D6E2060269647D61607E1632D6E2060269647D616
  89. 078B9C1BB691DBBF1BB691D6E2070368616273756478B9C150FA11C432D6E207
  90. 036865696768647D6E2060367796464786E1632D6E2060367796464786D6E203
  91. 0D637768B9C1EEDA1B9691D6E207036865696768647B9691614E1C2A20520002
  92. 45796C64696E67602269647D61607E29C2A2485A19C2A2D6E2030D637768B9C1
  93. 0A132D6E201096D6E201096B0BC1C2A20700000276BA1D6E201096D6E2030D63
  94. 7768B9C150FA1339202000000000000010EEDA14B2A255DB1B0BC176BA1C2A20
  95. 700005276BA1ED2A2485A1D6E2010969C2A290DA1D6E2060367796464786EEDA
  96. 1B9691E4A20510000000000000000000ED2A2387C1D6E2060269647D61607D6E
  97. 207036861627375647D6E2030D63776D6E201096D6E201096C58C14BAC13CE22
  98. 78BF14B2A2D9AE1AFE22D9D209C2A290DA1D6E2060367796464786EEDA1B9691
  99. E4A20510000000000000000000ED2A2387C178BF1B7FC18DBF1D6E2070368656
  100. 967686479C2A290DA176BA1DBBF1D6E20603677964647869C2A290DA176BA1DB
  101. BF1ED2A2387C1C58C1AE8C1B21305BF22D9D208DBF18DBF18DBF1B21305DF22C
  102. 4232EF532EF53293632B21306C3003045351530D9D20E1632B7FC18DBF11C432
  103. D6E2030D63776D6E207036861627375647D6E2060269647D61607E1632D6E206
  104. 0269647D616078B9C1BB691DBBF1BB691D6E2070368616273756478B9C150FA1
  105. 1C432D6E207036865696768647D6E2060367796464786E1632D6E2030D63776D
  106. 6E207036861627375647D6E2060269647D61607ED2A2387C184E203045D87478
  107. BF18B9C1DBBF1BB691C2A2091000269647D6160702963702DBBF1B0BC176BA1C
  108. 2A20D00000226970276BA1DBBF1BB691B0BC176BA19C2A2485A19C2A2F17A178
  109. BF18B9C18DBF133920200000000000262076BA1339201000000000000230D6E2
  110. 07036865696768647ED2A250FA176BA1B9691614E1DBBF1E4A20510003800000
  111. 000000000E4A20510000200000000000000D6E207036865696768647ED2A250F
  112. A190DA1ED2A2387C1DBBF1AE8C178BF18B9C1BB691DBBF1BB691DBBF19C2A24B
  113. 2A24B2A21C432D6E20407627F626D6E2060767796464786D6E20707686569676
  114. 8647D6E204037475607D6E204046F6E656D6E204077169647E1632E4A2051000
  115. 3800000000000000E4A20510000400000000000000614E1634E1DCC0247A20E4
  116. A20510000000000000000000E4A20510000000000000000000B21300F2E13C03
  117. 24B2A2D6E206076779646478633920200000000000131090DA10A132D6E20108
  118. 7634E147A20E4A20510000000000000000000E4A20510000000000000000000B
  119. 2130D6E20407627F626D6E201087B9691E4A20510000000000000000000ED2A2
  120. 387C1D6E20108733920200000000000031076BA1B9691E4A2051000040000000
  121. 0000000ED2A2387C1C58C1AE8C13CE22D6E2040771696474B2A2D9AE1AFE22D9
  122. D20D6E204077169647F17A1B21305DF223CE22378A1AFE22D9D201C432D6E201
  123. 0B6E1632D8732D9D20D6E2010B6339201000000000000150279E18A732D9D20D
  124. 6E2060767796464786D6E20108776BA145632D6E20108797632DCC02B21305DF
  125. 22D6E2010B6339201000000000000560279E18A732D9D20D6E20407716964733
  126. 920999000000000001090DA14B2A217CB145632D6E20407716964797632DCC02
  127. B21305DF22D6E2010B6339201000000000000570279E18A732D9D20339209990
  128. 00000000001045632D6E20407716964797632B4402B21305DF22D6E2010B6339
  129. 201000000000000580279E18A732D9D20D6E2040374756079C2A290DA19C2A21
  130. 7CB145632D6E20403747560797632DCC02B21305DF22D6E2010B633920100000
  131. 0000000590279E18A732D9D20D6E2040374756079C2A276BA1D6E20607677964
  132. 6478633920200000000000131090DA1ED2A250FA13ECB145632D6E2040374756
  133. 0797632DCC02B21305DF229C2A28A732D9D209C2A245632D6E204046F6E65697
  134. 632DCC02B21305DF22B21305DF22EF532B21305DF22D6E20403747560708332D
  135. E032D6E204046F6E6569B632EF532EF532EF53293632B21304580060D4B464F4
  136. E44560D9D20E16321C432D6E207036861627375647D6E204066F6E647D6E2040
  137. A7F6F6D6E1632C2A207000085D6E204066F6E647DA5E18B9C1BB691DBBF1BB69
  138. 11C432D6E207036865696768647D6E2060367796464786E1632C2A2072000D41
  139. 6B696E67602C6162776560266F6E64733920100000000000001066BC176BA1C2
  140. A209200005C656163756022656020716479656E647E276BA19C2A2485A1D6E20
  141. 7036861627375647D6E207036861627375647D6E204066F6E647DA5E1D6E2040
  142. A7F6F6D684E2060249474745425ED2A2387C1C2A20900007264D6E204066F6E6
  143. 47B0BC176BA1C2A2070000A576BA1D6E2040A7F6F6D6B0BC176BA1C2A2070000
  144. 7276BA1B7FC1DCC02EF532EF53293632B2130F22006024947474542560D9D20E
  145. 163292CF18B9C1BB691DBBF1BB691DBBF11C432D6E2050F67627F626D6E2010A
  146. 7D6E201077D6E201086E1632D6E201077D6E2010A7EEDA1B9691D6E201086D6E
  147. 2010A7EEDA1B9691614E1D6E2010A7B969178BF1614E1599A11C432D6E203026
  148. C6B6E16324B2A2D6E2010779C2A290DA10A132D6E201087D6E201087D6E20107
  149. 750FA1339203000000000000010EEDA1D6BB133920100000000000001050FA1B
  150. 0BC133920100000000000001066BC1C2A205000076BA176BA19C2A2485A13CE2
  151. 2D6E2050F67627F626D6E201087B9691E4A20510000000000000000000ED2A23
  152. 87C1D6E201087B9691D6E201086B9691ED2A2387C1C58C1E4A20510001000000
  153. 000000000D6E201086B9691614E1D9AE1AFE22D9D204B2A2D6E2010869C2A290
  154. DA10A132D6E2010973CE22D6E2050F67627F626D6E201087B9691D6E201097B9
  155. 691ED2A2387C178BF1C58C1E1B2011000100001000010279E1AFE22D9D20D6E2
  156. 01087D6E2010A7EEDA1B9691D6E201097D6E2010A7EEDA1B9691ED2A2387C1D6
  157. E203026C6B6AE8C1B21305DF22C4232B21305DF22C4232EF532EF53293632B21
  158. 30A1EB"
  159. END_ASC
  160.  
  161. BYTES: #BE1Ah 2280.5
  162.  
  163. BEGIN_UU tsq.uue
  164. begin 644 tsq
  165. M2%!(4#0X+466*O!_8@X````#5(U'`YTMX&$C>\^!O1_!--+F`@-M<V=M+G`P*
  166. MAA8F-U=&U^8"!F)I=&UA<!XVTN8"!F)I=&UA<+C)L6L9O?NQ:QEM+G`PAA8FC
  167. M-U=&AYL<!:\13"-M+G`PAE:6=H9&U^8"!F-W:61T:!XVTN8"!F-W:61T:&TN.
  168. M,-`V=X:;'.ZML6D9;2YP,(96EG:&1K=I&1;DP:(")0`@5)?&1I;F=@8BED;7N
  169. M%@;GDBPJA*61+"IM+C#0-G>&FQR@,=+F`@%I;2X0D+:P'"PJ<```(&>KT>8"6
  170. M`6EM+C#0-G>&FQP%KS&3`@(````````![JU!*RI5O;&P'&>KP:("!P!0<K8:G
  171. MWJ)"6!IM+A"0EBPJ":W1Y@(&8W=I9'1H[JVQ:1E.*E`!````````````WJ(RF
  172. M>!QM+F`@ED;7%@;7Y@('8VAA<G-E=&TN,-`V=];F`@%I;2X0D,:%'+3*,>PBY
  173. MA_M!*RJ=ZJ'O(ITMD"PJ":W1Y@(&8W=I9'1H[JVQ:1E.*E`!````````````0
  174. MWJ(R>!R'^['W'-C[T>8"!V-H96EG:'3)HI+0&F>KT;L?;2Y@,':71D:'EBPJH
  175. M":UQMAJ]^^$M*H/'P84<ZLBQ$@.U+]+9`MC[@;T?V/NQ$@/5+\(D(_XUXE\C8
  176. M.3:R$@/&`S!`-14UT-D"'C:R]QS8^Q%,(VTN,-`V=];F`@=C:&%R<V5T;2Y@Y
  177. M()9&UQ8&YV$C;2Y@()9&UQ8&AYL<NY;1NQ^[EM'F`@=C:&%R<V5TN,E1\!K![
  178. M--+F`@=C:&5I9VAT;2Y@,':71D:'YF$C;2XPT#9WUN8"!V-H87)S971M+F`@"
  179. MED;7%@;G+2J#QX'D`@-4C4>'^X&;'+W[L6L9+"J0`0!B:71M87`@:7,@O?NQ!
  180. ML!QGJ\&B`@T``"*6!W*V&KW[L6L9"\MQMAK)HD)8&LFB\G$:A_N!FQS8^S&3L
  181. M`@(``````&("9ZLQDP(!```````@`VTN<#"&5I9VAD;G+2H%KW&V&IN684$>A
  182. MO?OAI`(5`#`(````````X*0"%0```@```````-#F`@=C:&5I9VATWJ)2\!H)Z
  183. MK>$M*H/'T;L?ZLAQN!^XR;%K&;W[L6L9O?N1+"JTHD(K*L$TTN8"!&=R;V)M.
  184. M+F!P=I=&1H?6Y@('9VAE:6=H=&TN0#!'5P;7Y@($9&]N96TN0'`7ED;G82-.`
  185. M*E`!`(,`````````3BI0`0!``````````!;D84,>S0Q"IP).*E`!````````O
  186. M````3BI0`0```````````"LQ`"\>PS!"*RIM+F!P=I=&1H<VDP("```````Q6
  187. M`0FM`1HC;2X0@&=#'G0JX*0"%0```````````."D`A4```````````"P$@-M$
  188. M+D!P)O<FUN8"`7B;EN&D`A4```````````#@+2J#Q]'F`@%X,RD@````````$
  189. M$W"V&IN6X:0"%0``!````````.`M*H/'P84<ZL@Q[")M+D!P%Y9&1RLJG>JAK
  190. M[R*=+=#F`@1W86ET'Z>Q$@/5+S+L(G.HH>\BG2T03"-M+A"PYF$CC3?2V0)M]
  191. M+A"P-I,"`0``````$`5RZ8%Z(YTMT.8"!F=W:61T:&TN$(!WMAI4-M+F`@%X5
  192. M>3;2S"`K,5#](FTN$+`VDP(!``````!0!G+I@7HCG2W0Y@($=V%I=#,ID)D`,
  193. M`````!"0T!JTHA+'&U0VTN8"!'=A:71Y-M+,("LQ4/TB;2X0L#:3`@$`````E
  194. M`%`'<NF!>B.=+3"3`ID)```````!5#;2Y@($=V%I='DVLD0@*S%0_2)M+A"P2
  195. M-I,"`0``````4`ARZ8%Z(YTMT.8"!'-T97#)HI+0&LFB$L<;5#;2Y@($<W1E/
  196. M<'DVTLP@*S%0_2)M+A"P-I,"`0``````4`ERZ8%Z(YTMT.8"!'-T97#)HG*V&
  197. M&FTN8'!VET9&AS:3`@(``````#$!":WA+2H%KS'.&U0VTN8"!'-T97!Y-M+,_
  198. M("LQ4/TBR:*">B.=+9`L*E0VTN8"!&1O;F5Y-M+,("LQ4/TB*S%0_2+^-;(29
  199. M`]4OTN8"!'-T97"`,](.(VTN0$#VYE:6:R/^->)?(_XUDF,C*S%`A0`&34M&]
  200. M3TY4!ITMX&$CP332Y@('8VAA<G-E=&TN0&#VYD;7Y@($>F]O;1XVPJ("!P"`"
  201. MU>8"!&9O;G2MY8&;'+N6T;L?NY813"-M+G`PAE:6=H9&U^8"!F-W:61T:!XVP
  202. MPJ(")P#0%+:6YG8&PA8F=U8&8O;F1C>3`@$````````!9LMQMAHL*I`"`%!LK
  203. M96%S92!B92!P871I96YT+F>KD2PJA*71Y@('8VAA<G-E=&TN<#"&%B8W5T;7]
  204. MY@($9F]N=*WET>8"!'IO;VU(+F`@E'1T5"3E+2J#Q\&B`@D`<&+4Y@($9F]NP
  205. M=`O+<;8:+"IP``!:9ZO1Y@($>F]O;0O+<;8:+"IP```G9ZNQ]QS-#.)?(_XU1
  206. MDF,C*S'P(@`&0DE'1T52!ITMX&$C*?R!FQR[EM&['[N6T;L?P332Y@(%;V=R8
  207. M;V)M+A"@U^8"`7=M+A"`YF$C;2X0<-?F`@%Z[JVQ:1EM+A"`UN8"`7KNK;%I1
  208. M&1;DT>8"`7J;EG&X'Q;D49D:P332Y@(#8FQK'C9"*RIM+A!PERPJ":T!&B-M(
  209. M+A"`U^8"`7AM+A!P5_`:,RDP````````$.#>&FV[,9,"`0````````$%K[&PU
  210. M'#,I$````````!!@MAPL*E```&>K<;8:R:)"6!K#+M+F`@5O9W)O8FTN$("W,
  211. M:1E.*E`!````````````WJ(R>!QM+A"`MVD9;2X0@+9I&=ZB,G@<7,CAI`(5Q
  212. M`!``````````T.8"`6B;EF%!'IWJH>\BG2U`*RIM+A"`EBPJ":T!&B-M+A"0V
  213. M-^PB;2Y0\'8F]R;6Y@(!>)N6T>8"`7F;EN$M*H/'<;@?7,CAL0(1`!````$`(
  214. M$""7'OHNTMD";2X0@-?F`@%Z[JVQ:1EM+A"0U^8"`7KNK;%I&=ZB,G@<;2XPS
  215. ?(,:VIHX<*S%0_2),,K(2`]4OPB0C_C7B7R,Y-K(2`[(2G
  216. ``
  217. end
  218. END_UU
  219.  
  220. BEGIN_RPL tsq.rpl
  221. %%HP: T(3)A(D)F(.);
  222. DIR
  223.   BIGGER
  224.     \<< 
  225.       OVER SIZE B\->R SWAP B\->R SWAP 
  226.       \-> ogrob z w h
  227.       \<< 
  228.         w z * R\->B h z * R\->B BLANK 
  229.         z R\->B DUP BLANK NEG 
  230.         \-> blk
  231.         \<< 
  232.           0 w 1 -
  233.           FOR x 
  234.             x w / 1000 * IP 10 / \->STR 10 CHR "" + + 1 DISP
  235.             IF ogrob x R\->B # 0d 2 \->LIST x R\->B h R\->B 2 \->LIST SUB
  236.                # 1d h R\->B BLANK \=/ THEN 
  237.               0 h 1 -
  238.               FOR y
  239.                 IF ogrob x R\->B y R\->B 2 \->LIST DUP SUB GROB 1 1 10 == THEN
  240.                   x z * R\->B y z * R\->B 2 \->LIST blk REPL
  241.                 END
  242.               NEXT
  243.             END
  244.           NEXT
  245.         \>>
  246.       \>>
  247.     \>>
  248.   MKFONT
  249.     \<< 
  250.       \-> charset font zoom
  251.       \<< 
  252.         "X" font \->GROB SIZE B\->R SWAP B\->R 
  253.         \-> cheight cwidth
  254.         \<<
  255.           "Making large font" 10 CHR + "Please be patient." + 1 DISP 
  256.           charset charset font \->GROB zoom BIGGER 2 \->LIST 
  257.           "'F" font \->STR + "Z" + zoom \->STR + "'" + OBJ\-> STO
  258.         \>>
  259.       \>>
  260.     \>>
  261.   TSQ
  262.     \<< 
  263.       OBJ\-> DROP 
  264.       \-> msg charset bitmap
  265.       \<< 
  266.         bitmap SIZE B\->R SWAP B\->R charset SIZE / 
  267.         \-> cheight cwidth
  268.         \<< 
  269.           msg charset bitmap 2 \->LIST T\->G
  270.           DUP SIZE SWAP B\->R "bitmap is " SWAP \->STR + " by " + SWAP B\->R
  271.           \->STR + 1 DISP 1 WAIT 
  272.           DUP SIZE DROP 262 + 32 cheight 2 / + R\->B BLANK SWAP 
  273.           # 131d # 32d cheight 2 / - 2 \->LIST SWAP REPL 
  274.           DUP SIZE B\->R SWAP B\->R SWAP 1 0 0 
  275.           \-> grob gwidth gheight step done wait
  276.           \<< 
  277.             # 131d # 64d BLANK PICT STO { # 0d # 0d } PVIEW
  278.             DO 
  279.               0 gwidth 131 -
  280.               FOR x
  281.                 PICT { # 0d # 0d } grob x R\->B # 0d 2 \->LIST 
  282.                 x 130 + R\->B # 64d 2 \->LIST SUB REPL
  283.                 IF wait 0 \=/ THEN 
  284.                   wait WAIT
  285.                 END
  286.                 IF KEY THEN 
  287.                   \-> k
  288.                   \<<
  289.                     CASE 
  290.                       k 51 == THEN gwidth x + 'x' STO END 
  291.                       k 65 == THEN wait .1 - 0 MAX 'wait' STO END 
  292.                       k 75 == THEN .1 'wait' STO+ END 
  293.                       k 85 == THEN step 1 - 1 MAX 'step' STO END 
  294.                       k 95 == THEN step 1 + gwidth 131 - 2 / MIN 'step' STO END
  295.                       1 THEN 1 'done' STO END
  296.                     END
  297.                   \>>
  298.                 END
  299.                 step
  300.               STEP
  301.             UNTIL done END
  302.           \>>
  303.         \>>
  304.       \>>
  305.     \>>
  306.   T\->G
  307.     \<< 
  308.       OBJ\-> DROP 
  309.       \-> msg charset bitmap
  310.       \<< 
  311.         bitmap SIZE B\->R SWAP B\->R charset SIZE / 
  312.         \-> cheight cwidth
  313.         \<< 
  314.           cwidth msg SIZE * R\->B cheight R\->B BLANK 
  315.           "Building bitmap." 1 DISP 
  316.           1 msg SIZE
  317.           FOR i 
  318.             i \->STR " " + i msg SIZE / 100 * 0 RND \->STR + "%" + 2 DISP
  319.             i 1 - cwidth * R\->B # 0d 2 \->LIST bitmap charset msg i i SUB POS
  320.             IF DUP 0 \=/ THEN 
  321.               1 - cwidth * R\->B # 0d 2 \->LIST DUP OBJ\-> DROP cheight 1 - +
  322.               SWAP cwidth 1 - + SWAP 2 \->LIST SUB REPL
  323.             ELSE
  324.               DROP DROP DROP
  325.             END
  326.           NEXT
  327.         \>>
  328.       \>>
  329.     \>>
  330. END
  331. END_RPL
  332.  
  333. --
  334. john.Latala@Waterloo.NCR.COM
  335.  
  336. /EARTH is 90% full, please delete anything superfluous...
  337.  
  338.